package com.yy.jhl.ui.manager.presenter;

import com.google.gson.Gson;
import com.yy.jhl.api.Api;
import com.yy.jhl.api.RxSubscriber;
import com.yy.jhl.bean.LoginInfo;
import com.yy.jhl.ui.manager.contract.MenuThreeContract;

import org.json.JSONException;
import org.json.JSONObject;

import okhttp3.FormBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;

import static com.yy.jhl.ui.user.contract.LoginContract.Presenter;

/**
 * Created by Ellis.Li on 2017/8/30.
 */

public class MenuThreePresenter extends MenuThreeContract.Presenter {
    @Override
    public void logout() {
        RequestBody requestBody = new FormBody.Builder()
                .build();
        mRxManage.addSubscription(Api.getDefault().logout(requestBody), new RxSubscriber<ResponseBody>(mContext,"退出登录中...",true) {
            @Override
            protected void _onNext(String result) {
                mView.logoutSuccess();
            }

            @Override
            protected void _onError(String message) {
                mView.logoutFail();
            }
        });
    }
}
